<template>
  <BasicModal
    @register="register"
    title="Modal Title"
    :helpMessage="['提示1', '提示2']"
    @ok="handleSubmit"
    @cancel="handleCancel"
  >
    <BasicForm @register="register2"> </BasicForm>
  </BasicModal>
</template>

<script lang="ts" setup>
  import { BasicForm, useForm } from '/@/components/Form';
  import { Guidance } from './data/Guidance';
  import { BasicModal, useModalInner } from '/@/components/Modal';
  import { defineEmits } from 'vue';
  const [register, { closeModal }] = useModalInner();
  const [register2, { validate, getFieldsValue }] = useForm({
    labelCol: {
      span: 8,
    },
    wrapperCol: {
      span: 10,
    },
    baseColProps: {
      //这个是占用位置,一行共24个
      span: 24,
    },
    schemas: Guidance,
    actionColOptions: {
      offset: 8,
      span: 12,
    },
    submitButtonOptions: {
      text: '提交',
    },
    showSubmitButton: false,
    showResetButton: false,
  });
  const emits = defineEmits(['giveGuidance']);
  async function handleSubmit() {
    await validate();
    const values = await getFieldsValue();
    emits('giveGuidance', values);
    closeModal();
  }

  function handleCancel() {
    closeModal();
  }</script
>./data/Guidance
